﻿namespace Homework2_5
{
    /// <summary>
    /// remove the hello.txt into the Cataloguesystem
    /// </summary>
    internal class Program
    {
        static void Main(string[] args)
        {
            // the file path of helllo.txt
            string helloFilePath = @"D:\CSharp2024\hello.txt";

            // the file path of cataloguesystem
            string catalogueDirectory = @"D:\CSharp2024\Cataloguesystem";

            //
            string catalogueFilePath = Path.Combine(catalogueDirectory, "hello.txt");

            // 移动文件
            try
            {
                File.Move(helloFilePath, catalogueFilePath);
                Console.WriteLine($"文件 {helloFilePath} 已成功移动到 {catalogueFilePath}");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"发生错误：{ex.Message}");
            }
        }
    }
}

